/*
 * @Author: Lee 497232807@qq.com
 * @Date: 2023-07-19 09:23:30
 * @LastEditors: Lee 497232807@qq.com
 * @LastEditTime: 2023-07-19 09:35:08
 * @FilePath: \ccc-hot-update\assets\Game\10000\TestNode.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { Sprite } from 'cc';
import { Color } from 'cc';
import { Label } from 'cc';
import { _decorator, Component, Node } from 'cc';
const { ccclass, property } = _decorator;

@ccclass('TestNode')
export class TestNode extends Component {

    @property(Label)
    lb_text: Label = null!;

    @property(Sprite)
    sprite_bg: Sprite = null!;

    start () {

        this.setText(Math.floor(Math.random()*1000).toString())
        this.randomBg()
    }

    protected setText(text: string) {
        this.lb_text.string = text;
    }

    protected randomBg() {
        this.sprite_bg.color = new Color(Math.random()*255, Math.random()*255, Math.random()*255);
    }
}


